#ifndef LOGINWGT_H
#define LOGINWGT_H
#include <QStackedWidget>
#include <QWidget>
#include "httphelper.h"
class AppConfig;
class LoginWgt : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWgt(QWidget *parent = nullptr);
public slots:
    void slo_Operator(const REQUESTTYPE type,bool result);
    void slo_MediaInfo(const QVector<QVariantMap> mediainfo);
protected:
    void mousePressEvent(QMouseEvent* event) override;
    void mouseMoveEvent(QMouseEvent* event) override;
    void mouseReleaseEvent(QMouseEvent* event) override;

private:
    void handleLogin(bool result);
    void handleRegister(bool result);
    void initLayout();

signals:
private:
    QPoint point;
    bool isPressed;
    QWidget* loginWgt;
    QWidget* registerWgt;
    QStackedWidget* stackedWgt;
    //拖拽状态标志
    bool m_bDrag = false;
    //鼠标按下时的位置偏移
    QPoint m_dragStartPos;//鼠标按下时初始位置（相对位置）
    QPoint m_dragGlobalPos;//鼠标按下时的全局坐标

};

#endif // LOGINWGT_H
